/**
 * 系统的路由配置
 * @author: minzhang
 * @update: 2017-03-07
 */

import React from 'react';
import {Router, Route, IndexRoute} from 'dva/router';
import {message} from 'antd';
import MainLayout from './routes/MainLayout/MainLayout';
import Billing from './routes/Billing/Billing';
import Order from './routes/Order/Order'
import StoreInfo from './routes/StoreInfo/StoreInfo';
import RoomsManage from './routes/RoomsManage/RoomsManage';
import ProductManage from './routes/ProductManage/ProductManage';
import RecommendManage from './routes/RecommendManage/RecommendManage';
import TechManage from './routes/TechManage/TechManage';
import MemberCard from './routes/MemberCard/MemberCard';
import TimesCard from './routes/TimesCard/TimesCard';
import ProjectManage from './routes/ProjectManage/ProjectManage';
import NotFound from './routes/NotFound/NotFound';

message.config({
  duration: 3,
});

export default function ({history}) {
  return (
    <Router history={history}>
      <Route path="/" component={MainLayout}>
        <IndexRoute component={Billing}/>
        <Route path="/order" component={Order}/>
        <Route path="/store-info" component={StoreInfo}/>
        <Route path="/rooms-manage" component={RoomsManage}/>
        <Route path="/project-manage" component={ProjectManage}/>
        <Route path="/product-manage" component={ProductManage}/>
        <Route path="/recommend-manage" component={RecommendManage} />
        <Route path="/tech-manage" component={TechManage}/>
        <Route path="/member-card" component={MemberCard}/>
        <Route path="/times-card" component={TimesCard}/>
        <Route path="*" component={NotFound}/>
      </Route>
    </Router>
  );
}
